<meta charset="utf-8">

<div class="box box-primary" id="pmpTasks_editExpiryTime">
	<form role="form" id="editForm">
	
	
		<div class="box-body">
			<div class="form-group">
				<label>截止时间</label>
			    <div class='input-group date' id='datetimepicker'> 
                     <input type='text' class="form-control" id="expiryTime" v-model="pmpTasks.expiryTime" /> 
                     <span class="input-group-addon"> 
                     <span class="glyphicon glyphicon-calendar"></span> 
                     </span> 
                </div>
            </div>
		</div>
		
		
		
		<div class="box-footer">
			<button type="button" class="btn btn-default" v-on:click="cancle">取消</button>
			<button type="button" class="btn btn-info pull-right" v-on:click="update">提交</button>
		</div>
		
		
		
	</form>
</div>
<script type="text/javascript">

$(function(){$('#datetimepicker').datetimepicker({
    format: "yyyy-mm-dd hh:ii",
    autoclose: true,
    todayBtn: true,
    language:'zh-CN',
    pickerPosition:"bottom-left"
  });
});

		var news = new Vue({
			el : '#pmpTasks_editExpiryTime',
			data : {
				pmpTasks : {
					id: null,
					projectId : null,
					projectVersionId : null,
					taskName : null,
					taskDetail : null,
					expiryTime : null
				},
				bus : new Vue(),
			},
			mounted : function() {
				var _this = this;
				var param = zfesLayerEditDg.getLayerParam();//任务id 
				var url = "/pmp/service/pub/pmpTasks/loadPmpTasks";
				zfesAjax.ajaxTodo(url, param, function(data) {
					_this.$data.pmpTasks = data.data.pmpTasks;
				})
			},
			methods : {
				update : function() {
					if ($("#editForm").valid()) {
						let _this = this;
						laydate.render({elem: '#expiryTime',type: 'datetime'});
						 _this.$data.pmpTasks.expiryTime=$("#expiryTime").val();
						let url = "/pmp/service/pm/pmpTasks/updateExpiryTime";
						zfesAjax.ajaxTodo(url,{"id":_this.pmpTasks.id,"expiryTime":_this.pmpTasks.expiryTime}, function(
								data) {
							alertSwal.successText(data.message);
							layer.close(layer.index);
						});
					}
				},
				cancle : function() {
					layer.close(layer.index);
				}
			}
		});
</script>
